//
//  MKUIPickerViewModel.h
//  MKUI
//	滚轮视图的数据模型
//  Created by sushangjin on 15/6/18.
//  Copyright (c) 2015年 sushangjin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "MKUIPickerViewComponentModel.h"
#import "MKUIPickerViewCellModel.h"

#import "MKCollectionModel.h"
#import "MKCollectionCellModel.h"
#import "MKCollectionSectionModel.h"

NS_ASSUME_NONNULL_BEGIN
@interface MKUIPickerViewModel : MKCollectionModel<UIPickerViewDataSource,UIPickerViewDelegate>
@property(nonatomic,weak,nullable) id<UIPickerViewDataSource> forwardDataSource;
@property(nonatomic,weak,nullable) id<UIPickerViewDelegate> forwardDelegate;
@property(nonatomic,weak,nullable) UIPickerView *pickerView;

- (void)setPickerViewDataSourceAndDelegate:(nullable UIPickerView *)pickerView;

- (id)initWithPickerView:(nullable UIPickerView *)pickerView;

/**
 *  刷新滚轮视图
 */
- (void)reloadPickerViewData;

/**
 *  设置滚轮的选中行
 *
 *  @param animated 是否动画
 */
- (void)selectPickerViewAnimated:(BOOL)animated;

/**
 *  返回单元格标题对应的单元格位置
 *
 *  @param titles 标题列表
 *
 *  @return 对应的位置列表
 */
- (nullable NSArray<NSIndexPath *> *)indexPathsForCellModelsWithTitles:(nullable NSArray<NSString *> *)titles;


@end
@interface MKUIPickerViewModel(SelectAnimated)
- (void)selectCellModelAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated;
- (void)selectCellModelsAtIndexPaths:(nullable NSArray<NSIndexPath *> *)indexPaths animated:(BOOL)animated;
- (void)selectCellModel:(nullable MKCollectionCellModel *)cellModel animated:(BOOL)animated;
- (void)selectCellModels:(nullable NSArray<MKCollectionCellModel *> *)cellModels animated:(BOOL)animated;
@end
NS_ASSUME_NONNULL_END
